package com.jxrj.interaction.service.impl;

import com.jxrj.interaction.dao.TeacherMapper;
import com.jxrj.interaction.entity.Teacher;
import com.jxrj.interaction.service.TeacherService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("teacherService")
public class TeacherServiceImpl implements TeacherService {
    private TeacherMapper teacherMapper;

    @Resource(name = "teacherMapper")
    public void setTeacherMapper(TeacherMapper teacherMapper) {
        this.teacherMapper = teacherMapper;
    }

    @Override
    public Teacher login(String teacher_email, String teacher_password) {
        return teacherMapper.selectByLogin(teacher_email,teacher_password);
    }

    @Override
    public Teacher getTeacher(long teacher_id) {
        return teacherMapper.selectById(teacher_id);
    }

    @Override
    public int updateHeadIcon(String teacher_imgName,long teacher_id) {
        return teacherMapper.updateHeadIcon(teacher_imgName,teacher_id);
    }

    @Override
    public int updatePersonalSign(String teacher_sign,long teacher_id) {
        return teacherMapper.updatePersonalSign(teacher_sign,teacher_id);
    }

    @Override
    public int updateNickname(String teacher_name, long teacher_id) {
        return teacherMapper.updateNickname(teacher_name,teacher_id);
    }
}
